import {
	createSSRApp
} from "vue";
import App from "./App.vue";
/*移动端一像素边框问题*/
import "./css/border.css"



import Constants from '@/common/constants.js';
import '@/css/index.css';
import '@/iconfont/iconfont.css'
//引入自定义图标并挂载 iconfont ;
import '@/iconfontSvg/line/iconfont.css'
import '@/iconfontSvg/fill/iconfont.css'
import '@/iconfontSvg/color/iconfont.css'
import '@/iconfontSvg/jpaasIcon/iconfont.css'
// #ifdef H5
import '@/iconfontSvg/color/iconfont.js'
// #endif
import Util from  './js/Util'
const app = createSSRApp(App);
app.config.globalProperties._vueAppLanguages = Constants.VUE_APP_LANGUAGES;
app.config.globalProperties._vueAppLanguage = Constants.VUE_APP_LANGUAGE;
app.config.globalProperties._vueAppIsLanguage = Constants.VUE_APP_ISLANGUAGE;
app.config.globalProperties.$rootFontSize = 100

app.config.globalProperties.$util = Util ;
app.config.globalProperties.$message = {
    success:(msg)=>{
        uni.showToast({
            title: msg,
            duration: 3000,
            icon: 'none'
        })
    },
    warning:(msg)=>{
        uni.showToast({
            title: msg,
            duration: 3000,
            icon: 'none'
        })
    }
} ;


/*引入签名控件*/

import Vue3Signature from "vue3-signature";
app.use(Vue3Signature)

// #ifdef H5
import VConsole from 'vconsole';
// 引入VConsole
if (Constants.VUE_APP_VCONSOLE == 'YES') {
    const vConsole = new VConsole();
    app.use(vConsole)

}
// #endif

import i18Parse from '@/common/i18Parse.js';
import i18n from '@/locales';
app.use(i18n);
app.config.globalProperties.$t=i18n.global.t;
app.config.globalProperties.$rootVm = app;
app.use(i18Parse);
import EventBus from '@/js/event-bus.js';
// 安装事件监听器插件
// 将事件总线安装为全局属性
app.config.globalProperties.$eventBus = EventBus;
import myIcon from '@/components/myIcon'
import RxFormItem from "@/views/modules/form/customForm/RxFormItem.vue"
import MComponent from '@/views/modules/MForm/MFormItem/MComponent'
app.component('my-icon', myIcon)
app.component('MComponent', MComponent)
app.component('rx-form-item', RxFormItem)
import appMobile from "@/js/appMobile.js"
app.mixin({
    mixins:[appMobile],
})

// #ifdef H5
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
VueMarkdownEditor.use(vuepressTheme);
app.use(VueMarkdownEditor);
// #endif

/*引入弹窗*/
import layer from '@/components/layer/layer.js'
app.use(layer,{
    components:{
        'my-icon':myIcon,
        'MComponent':MComponent,
        'rx-form-item':RxFormItem
    },
    use:{}
})

/**
 * 引入图表
 */
import * as Echarts from 'echarts'
app.config.globalProperties.$echarts = Echarts

export function createApp() {
	return {
		app,
		i18n
	}
}
